#include <bits/stdc++.h>

using namespace std;

class CustomFunction
{
public:
    int f(int x, int y);
};

class Solution
{
public:
    vector<vector<int>> findSolution(CustomFunction &customfunction, int z)
    {
        vector<vector<int>> ret;
        for (int x = 1, y = 1000; x < 1000 && y > 0;)
        {
            if (customfunction.f(x, y) > z)
            {
                --y;
            }
            else if (customfunction.f(x, y) < z)
            {
                ++x;
            }
            else
            {
                ret.push_back({x, y});
                ++x;
            }
        }
        return ret;
    }
};